#include "stdafx.h"
#include "LoggingEventHandler.h"
#include "SOCK_Stream.h"
#include <time.h>
#include <sstream> 

namespace Network 
{
	
	/*
	std::string LoggingEventHandler::handle(unsigned char* data) {
		LogEvent event;

		if(deserializeLogEvent((char*)data, &event) != 0){
			fprintf(stdout, "Error in deserialization of LogEvent!");
		}

		time_t timestamp;
		time(&(timestamp));

		LogListItem logListItem(event, timestamp);
		logs.push_back(logListItem);

		char buffer[26];
		ctime_s(buffer, 26, &(logListItem.timestamp));
		
		std::ostringstream out;
		out << "Log received at " << buffer << " with text " << logListItem.event.text.c_str() << " \n";
		std::string str( out.str());
		return str;
	}
	*/
}